package main

import (
	"fmt"
	"os"
	"os/signal"
	"time"
)

func main() {
	//os.Signal
	//
	//os.Getpid()
	//os.Getppid()
	//os.Getgid()
	//os.Getgroups()
	//os.Getuid()
	//os.Getwd()
	//exec.Cmd{}
	//
	//exec.Command()
	//exec.CommandContext().

	TestSignal()
}

func TestSignal() {
	signal.Ignore() //忽略所以信号

	signals := make([]os.Signal, 1)

	go func() {
		for sig := range signals {
			fmt.Printf("收到信号：%#v\n", sig)

		}
	}()

	go func() {
		for {
			<-time.After(time.Second)
			fmt.Println(":::", time.Now().Second())
		}
	}()

	<-time.After(time.Second * 2)
	//signal.Ignore(os.Interrupt)
	//signal.Ignore() //忽略所以信号
	//signal.Notify()
	//signal.NotifyContext()
	//signal.Stop()
	//signal.Reset()

	<-time.After(time.Second * 30)
}
